package com.ms.demo;

/**
 * @description: 具体观察者角色 1
 * @author: ms
 * @create: 2022-10-27 16:10
 */
public class BinaryObserver extends Observer{

    public BinaryObserver(Subject subject){
        this.subject = subject;
        this.subject.attach(this);
    }

    @Override
    public void update() {
        System.out.println( "二进制为: " + Integer.toBinaryString( subject.getState() ) );
    }
}